package com.solution.service;

import java.util.List;

import com.solution.exception.ServiceBeanException;
import com.solution.model.UserPermissionType;
import com.solution.model.UserRolePermission;
import com.solution.model.UserRoleType;


/**
 * This interface exposes all the services for creation, update, read and
 * deletion of User Role.
 * 
 *
 */
public interface UserRolePermissionService {

	/**
	 * This service creates the Role entry in the database after performing
	 * required business logic.
	 * @param userRoleType
	 * @param permissionIDs
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserRoleType create(UserRoleType userRoleType,String permissionIDs[]) throws ServiceBeanException;

	/**
	 * This service updates the Role entry in the database after performing
	 * required business logic.
	 * @param userRoleType
	 * @param Permission
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserRoleType update(UserRoleType userRoleType,String Permission[]) throws ServiceBeanException;
	
	/**
	 * This service reads a Role from database based on the primary
	 * key.
	 * @param userRoleTypeID
	 * @return
	 * @throws ServiceBeanException
	 */
	public UserRoleType read(Long userRoleTypeID) throws ServiceBeanException;
	
	/**
	 * This service deletes a Role from database based on the primary
	 * key.
	 * @param userRoleTypeID
	 * @throws ServiceBeanException
	 */
	public void delete(Long userRoleTypeID) throws ServiceBeanException;
	
	
	/**
	 * Get complete list of permissions
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserPermissionType> getPermissionList()	throws ServiceBeanException ;

	/**
	 * get List of roles
	 * @param roleName
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserRoleType> getUserRolesList(String roleName) throws ServiceBeanException;
	
	/**
	 * get Permission List of Roles
	 * @param roleID
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserRolePermission> getRolePermissionList(Long roleID) throws ServiceBeanException ;
	
	/**
	 * get list of permissions for user
	 * @param userID
	 * @return
	 * @throws ServiceBeanException
	 */
	public List<UserPermissionType> getPermissionListByUserId(Long userID) throws ServiceBeanException ;

	public UserPermissionType createUserPermissionType(UserPermissionType userPermissionType) throws ServiceBeanException;
}
